<?php

class BisnaLabel extends TemplateTag
{
	protected $text;
	
	public function initialize()
	{
		if ( $this->DOMNode->hasAttribute( "default" ) ) {
			$this->setText( $this->DOMNode->getAttribute( "default" ) );
		}
	}


	public function render()
	{
    	$span = $this->DOM->createElement( "span" );
    	$span->setAttribute( "id", $this->id );
    	$span->appendChild( $this->text );
    	
    	$parentNode = $this->DOMNode->parentNode;
    	$parentNode->replaceChild( $span, $this->DOMNode );

    	$this->DOMNode = $span;
	}
	

	public function getText()
	{
		return $this->text->nodeValue;
	}
	
	
	public function setText( $text )
	{
		$this->text = $this->DOM->createTextNode( $text );
	}
	
	
	public function setHtml( $text )
	{
		$this->text = $this->DOM->createDocumentFragment();
		$this->text->appendXML( $text );
	}
}

?>